package com.system.controller;


import com.baomidou.mybatisplus.extension.api.R;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.system.entity.User;
import com.system.service.UserService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author hujunwei
 * @since 2021-11-10
 */
@RestController
@RequestMapping("/user")
@Validated
public class UserController {
    @Autowired
    private UserService userService;

    @PostMapping("/add")
    @ApiOperationSupport(order = 1, ignoreParameters = "param.id")
    @ApiOperation(value = "测试LogHandler", notes = "xxcv")
    public R add(@RequestBody @Valid User param) {
        userService.save(param);
        return R.ok("新增成功!");
    }


}

